<!DOCTYPE html>
<html lang="en">
    <head>
        <title>SO question 4112686</title>
        <script src="http://code.jquery.com/jquery-latest.min.js"></script>
        <script>
        $(document).ready(function() {                           // When the HTML DOM is ready loading, then execute the following function...
            $('#somebutton').click(function() {                  // Locate HTML DOM element with ID "somebutton" and assign the following function to its "click" event...
                $.post('Home', function(responseJson) {    // Execute Ajax GET request on URL of "someservlet" and execute the following function with Ajax response JSON...
                    var $ul = $('<ul>').appendTo($('#somediv')); // Create HTML <ul> element and append it to HTML DOM element with ID "somediv".
                    $.each(responseJson, function(index, item) { // Iterate over the JSON array.
                        $('<li>').text(item).appendTo($ul);      // Create HTML <li> element, set its text content with currently iterated item and append it to the <ul>.
                    });
                });
            });
        })

        </script>
 
    </head>
    <body>
        <button id="somebutton">press here</button>
        <div id="somediv"></div>
        
        
        
        <div>
        <form action="login.do" method="post">
			Name: <input type="text" name="userName"><br>
			E-mail: <input type="password" name="pwd"><br>
			<input type="submit">
		</form>
    
        </div>
    </body>
</html>